package com.platform.modules.report.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Objects;
import java.util.Set;


/**
 * @param <T>
 */
@Data
@ApiModel("报表BaseItem")
@NoArgsConstructor
@AllArgsConstructor
public class BaseItemDTO<T> {

    @ApiModelProperty("name")
    String name;

    @ApiModelProperty("value")
    T value;

    @ApiModelProperty("type")
    String type;

    /**
     * 判断是否包含 name 相同对象
     * @param o
     * @return
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BaseItemDTO<?> that = (BaseItemDTO<?>) o;
        return type.equals(that.type);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type);
    }

}
